<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简历投递 - 人才职业生涯规划平台</title>
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <style>
        /* 基础样式 */
        body {
            background-color: #f8f9fa;
            color: #333;
        }
        
        .app-container {
            max-width: var(--iphone15-width, 390px);
            margin: 0 auto;
            padding-bottom: calc(50px + env(safe-area-inset-bottom, 0));
        }
        
        /* 头部导航 */
        .page-header {
            display: flex;
            align-items: center;
            padding: 15px;
            background-color: #fff;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }
        
        .back-button {
            border: none;
            background: none;
            font-size: 20px;
            color: #333;
            padding: 0 10px 0 0;
            display: flex;
            align-items: center;
            cursor: pointer;
        }
        
        .page-title {
            font-size: 18px;
            font-weight: 600;
            flex: 1;
            text-align: center;
            margin-right: 30px; /* 补偿返回按钮宽度 */
        }
        
        .main-content {
            padding: 15px;
        }
        
        /* 状态筛选选项卡 */
        .status-tabs {
            display: flex;
            background-color: #fff;
            padding: 0 10px;
            border-bottom: 1px solid #eee;
            margin: 0 -15px 15px; /* 左右贴边 */
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            white-space: nowrap;
            position: sticky;
            top: 55px;
            z-index: 99;
        }
        
        .status-tabs .tab {
            padding: 12px 15px;
            font-size: 15px;
            color: #666;
            position: relative;
            cursor: pointer;
            transition: color 0.3s;
            border-bottom: 3px solid transparent;
        }
        
        .status-tabs .tab.active {
            color: #4a6fee;
            font-weight: 500;
            border-bottom-color: #4a6fee;
        }
        
        /* 投递卡片 */
        .application-card {
            background-color: #fff;
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 15px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        }
        
        .company-info {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .company-logo {
            width: 45px;
            height: 45px;
            border-radius: 6px;
            object-fit: cover;
            margin-right: 12px;
        }
        
        .company-details {
            flex: 1;
        }
        
        .job-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 3px;
        }
        
        .company-name {
            font-size: 14px;
            color: #666;
        }
        
        .application-details {
            margin-bottom: 15px;
            padding-top: 10px;
            border-top: 1px solid #f5f5f5;
        }
        
        .application-details p {
            font-size: 14px;
            color: #555;
            margin: 8px 0;
            display: flex;
            align-items: center;
        }
        
        .application-details p i {
            margin-right: 8px;
            color: #888;
            font-size: 16px;
            width: 16px;
            text-align: center;
        }
        
        .status-tag {
            display: inline-block;
            padding: 3px 8px;
            font-size: 12px;
            border-radius: 4px;
            font-weight: 500;
        }
        
        .status-pending {
            background-color: #fff3e0;
            color: #ffa726;
        }
        
        .status-offer {
            background-color: #e8f5e9;
            color: #66bb6a;
        }
        
        .status-rejected {
            background-color: #fce4ec;
            color: #f48fb1;
        }
        
        .application-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding-top: 10px;
            border-top: 1px solid #f5f5f5;
        }
        
        /* 按钮 */
        .btn {
            padding: 6px 15px;
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;
            border: 1px solid transparent;
            transition: all 0.3s ease;
        }
        
        .btn-sm {
            padding: 4px 10px;
            font-size: 13px;
        }
        
        .btn-primary {
            background-color: #4a6fee;
            color: white;
            border-color: #4a6fee;
        }
        
        .btn-secondary {
            background-color: #f1f3f5;
            color: #6c757d;
            border-color: #dee2e6;
        }
        
        /* 空状态 */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: #666;
        }
        
        .empty-state img {
            width: 80px;
            height: 80px;
            margin-bottom: 15px;
            opacity: 0.7;
        }
        
        .empty-state p {
            font-size: 15px;
            margin-bottom: 15px;
        }
    </style>
</head>
<body>
    <div class="app-container">
        <!-- 头部导航 -->
        <header class="page-header">
            <button class="back-button" onclick="history.back()">
                <i class="bi bi-chevron-left"></i>
            </button>
            <h1 class="page-title">简历投递</h1>
        </header>

        <!-- 主内容区域 -->
        <main class="main-content">
            <!-- 状态筛选选项卡 -->
            <div class="status-tabs">
                <div class="tab active" data-status="all">全部</div>
                <div class="tab" data-status="pending">待处理</div>
                <div class="tab" data-status="offer">录用</div>
                <div class="tab" data-status="rejected">不合适</div>
            </div>
            
            <!-- 投递列表容器 -->
            <div class="applications-list">
                <!-- 示例：待处理 -->
                <div class="application-card" data-status="pending">
                    <div class="company-info">
                        <img src="../img/company1.jpg" alt="公司Logo" class="company-logo">
                        <div class="company-details">
                            <div class="job-title">前端开发工程师</div>
                            <div class="company-name">字节跳动</div>
                        </div>
                    </div>
                    <div class="application-details">
                        <p><i class="bi bi-calendar-check"></i> 投递时间：2023-05-15 14:30</p>
                        <p><i class="bi bi-file-earmark-text"></i> 使用简历：校招简历.pdf</p>
                        <p><i class="bi bi-info-circle"></i> 状态：<span class="status-tag status-pending">待处理</span></p>
                    </div>
                    <div class="application-actions">
                        <button class="btn btn-secondary btn-sm" onclick="deleteApplication(this)">撤回申请</button>
                        <a href="application-detail.html?id=1001&status=pending" class="btn btn-primary btn-sm">查看详情</a>
                    </div>
                </div>
                
                <!-- 示例：待处理（第二个） -->
                <div class="application-card" data-status="pending">
                    <div class="company-info">
                        <img src="../img/company2.jpg" alt="公司Logo" class="company-logo">
                        <div class="company-details">
                            <div class="job-title">产品经理</div>
                            <div class="company-name">腾讯</div>
                        </div>
                    </div>
                    <div class="application-details">
                        <p><i class="bi bi-calendar-check"></i> 投递时间：2023-05-12 09:45</p>
                        <p><i class="bi bi-file-earmark-text"></i> 使用简历：校招简历.pdf</p>
                        <p><i class="bi bi-info-circle"></i> 状态：<span class="status-tag status-pending">待处理</span></p>
                    </div>
                    <div class="application-actions">
                        <button class="btn btn-secondary btn-sm" onclick="deleteApplication(this)">撤回申请</button>
                        <a href="application-detail.html?id=1002&status=pending" class="btn btn-primary btn-sm">查看详情</a>
                    </div>
                </div>
                
                <!-- 示例：录用 -->
                <div class="application-card" data-status="offer">
                    <div class="company-info">
                        <img src="../img/company4.jpg" alt="公司Logo" class="company-logo">
                        <div class="company-details">
                            <div class="job-title">UI设计师</div>
                            <div class="company-name">网易</div>
                        </div>
                    </div>
                    <div class="application-details">
                        <p><i class="bi bi-calendar-check"></i> 录用时间：2023-05-05</p>
                        <p><i class="bi bi-currency-yen"></i> 薪资待遇：15k-20k</p>
                        <p><i class="bi bi-info-circle"></i> 状态：<span class="status-tag status-offer">已录用</span></p>
                    </div>
                    <div class="application-actions">
                        <button class="btn btn-secondary btn-sm">接受Offer</button>
                        <a href="application-detail.html?id=1004&status=offer" class="btn btn-primary btn-sm">查看详情</a>
                    </div>
                </div>
                
                <!-- 示例：不合适 -->
                <div class="application-card" data-status="rejected">
                    <div class="company-info">
                        <img src="../img/company5.jpg" alt="公司Logo" class="company-logo">
                        <div class="company-details">
                            <div class="job-title">数据分析师</div>
                            <div class="company-name">百度</div>
                        </div>
                    </div>
                    <div class="application-details">
                        <p><i class="bi bi-calendar-check"></i> 投递时间：2023-04-20 16:30</p>
                        <p><i class="bi bi-file-earmark-text"></i> 使用简历：校招简历.pdf</p>
                        <p><i class="bi bi-info-circle"></i> 状态：<span class="status-tag status-rejected">不合适</span></p>
                        <p><i class="bi bi-chat-left-text"></i> 反馈：感谢您的申请，但您的经验与我们的要求不太匹配。</p>
                    </div>
                    <div class="application-actions">
                        <a href="application-detail.html?id=1005&status=rejected" class="btn btn-secondary btn-sm">查看详情</a>
                        <a href="internships.html" class="btn btn-primary btn-sm">查看类似职位</a>
                    </div>
                </div>
            </div>
            
            <!-- 空状态 -->
            <div class="empty-state" style="display: none;">
                <img src="../img/empty-applications.svg" alt="暂无投递">
                <p>您还没有相关的简历投递记录</p>
                <a href="internships.html" class="btn btn-primary">浏览职位</a>
            </div>
        </main>

        <!-- 底部导航栏 -->
        <footer class="tab-bar">
            <a href="../index.html" class="tab-item">
                <i class="bi bi-house-door"></i>
                <span>首页</span>
            </a>
            <a href="discover.html" class="tab-item">
                <i class="bi bi-compass"></i>
                <span>发现</span>
            </a>
            <a href="agents.html" class="tab-item">
                <i class="bi bi-person-rolodex"></i>
                <span>经纪人</span>
            </a>
            <a href="profile.html" class="tab-item active">
                <i class="bi bi-person-fill"></i>
                <span>我的</span>
            </a>
        </footer>
    </div>

    <script src="../js/nav.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 底部导航栏滚动隐藏逻辑
            let lastScrollTop = 0;
            let scrollTimer;
            const tabBar = document.querySelector('.tab-bar');
            const scrollThreshold = 20;
            
            function handleScroll() {
                const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop;
                if (Math.abs(lastScrollTop - currentScrollTop) > scrollThreshold) {
                    if (currentScrollTop > lastScrollTop && currentScrollTop > 100) {
                        if (tabBar) tabBar.classList.add('tab-bar-hidden');
                    } else if (currentScrollTop < lastScrollTop) {
                        if (tabBar) tabBar.classList.remove('tab-bar-hidden');
                    }
                    lastScrollTop = currentScrollTop;
                }
                clearTimeout(scrollTimer);
                scrollTimer = setTimeout(function() {
                    if (tabBar) tabBar.classList.remove('tab-bar-hidden');
                }, 1000);
            }
            window.addEventListener('scroll', handleScroll);
            
            // 状态选项卡筛选功能
            const statusTabs = document.querySelectorAll('.status-tabs .tab');
            const applicationCards = document.querySelectorAll('.application-card');
            const emptyState = document.querySelector('.empty-state');

            function filterApplications(selectedStatus) {
                let hasVisibleCards = false;
                applicationCards.forEach(card => {
                    const cardStatus = card.getAttribute('data-status');
                    if (selectedStatus === 'all' || cardStatus === selectedStatus) {
                        card.style.display = 'block';
                        hasVisibleCards = true;
                    } else {
                        card.style.display = 'none';
                    }
                });
                
                // 显示或隐藏空状态
                if (emptyState) {
                    emptyState.style.display = hasVisibleCards ? 'none' : 'block';
                }
            }

            statusTabs.forEach(tab => {
                tab.addEventListener('click', function() {
                    // 更新选项卡激活状态
                    statusTabs.forEach(t => t.classList.remove('active'));
                    this.classList.add('active');
                    
                    // 获取选择的状态并筛选
                    const selectedStatus = this.getAttribute('data-status');
                    filterApplications(selectedStatus);
                });
            });

            // 初始加载时显示全部
            filterApplications('all');
            
            // 设置全局函数
            window.deleteApplication = function(button) {
                const card = button.closest('.application-card');
                const jobTitle = card.querySelector('.job-title').textContent;
                const companyName = card.querySelector('.company-name').textContent;
                
                if (confirm(`确定要撤回 ${companyName} 的 ${jobTitle} 职位申请吗？`)) {
                    // 模拟撤回成功
                    card.style.transition = 'opacity 0.3s, transform 0.3s';
                    card.style.opacity = '0';
                    card.style.transform = 'scale(0.95)';
                    setTimeout(() => {
                        card.remove();
                        // 重新检查空状态
                        filterApplications(document.querySelector('.status-tabs .tab.active').getAttribute('data-status')); 
                    }, 300);
                }
            };
        });
    </script>
</body>
</html> 